import WebSocket from 'ws';

var ws = new WebSocket('ws://localhost:5765?id=kdl&key=76098491');

ws.on('error', function error(event) {
   console.log("WebSocket Error:", event);
});

ws.on('close', function close() {
  console.log('Connection closed');
})

ws.on('open', function open() {
  ws.send("hello,i am test client")
});

ws.on('message', function message(data) {
  console.log('Received: %s', data);
});
